Skip to content

Logging enhancements - #28

Open
mwsis wants to merge 30 commits into
synesissoftware:masterfrom
mwsis:logging-enhancements
Open

mwsis wants to merge 30 commits into
synesissoftware:masterfrom
mwsis:logging-enhancements

Conversation

@mwsis

@mwsis mwsis commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

mwsis added 27 commits November 18, 2026 21:17
Name parse_verbosity() in the 0.9.0 notes, and record the 0.17.0
compatibility update as Python 3.14.
Log f_lineno for a module-level trace() call, and cover it with a unit test
that the reported line is the call rather than line 1.
Pass keyword arguments from func() and line() through to the
caller-location lookup, including basename.
Apply str() to a log message after invoking a callable, so a non-string
such as an exception is written instead of raising TypeError.
Include DEBUG, an alias of DEBUG5, in the severity and package __all__
lists, matching FAIL, WARN, and INFO.
Pop file from dbg() and dbgfl() keyword arguments before tracing, and
remove the unused list(kwargs) call in _dbg.
Let set_log_filter() take a callable of the severity, and skip the message
when that callable returns false.
Run the Python 3.8–3.14 build job on macOS, Ubuntu, and Windows, and skip
3.8 and 3.9 on macOS where there is no arm64 build.
ubuntu-latest is Ubuntu 26.04 and has no CPython 3.8 or 3.9 tool cache, so
those two versions use ubuntu-22.04.
Move STOCK_TRAILING_PROMPT under Contingent Reporting and the severity
constants under Diagnostic Logging.
Log a warn() line only when WARNING passes the log filter, and invoke a
callable message once for the log line and the contingent report.
Remove the empty tests/stub.py and add cases for abort() exiting, a Windows
basename, clearing the log filter, concurrent log calls, and
asynctracefunc.
Define tracefunc and asynctracefunc on every supported Python, using
getargspec when inspect.signature is absent.
Keep the wrapped name and docstring, accept a file argument, and await
coroutines, and leave staticmethod and classmethod parameters named self as
ordinary parameters.
Add the B rules beside E and F, ignore B904 because raise-from is invalid
on Python 2.7, and test callability with callable().
Prefer `time.monotonic()` when `perf_counter_ns` is absent. Python 2.7
still uses `time.time()`, which is the only clock it provides. Added a
manual timing script, **tests/performance/bench_logging.py**, which
`unittest` discover does not collect.
`__version__` in **diagnosticism/__init__.py** is now **0.18.2**.
**pyproject.toml** and **setup.py** read that attribute, and the install
smoke compares package metadata with it. Removed **setup.cfg**, which only
set `universal = 1`.
Add **INSTALL.md** and **FAQ.md**, and link them from the README. Older
**CHANGES.md** bullets now end with `;`. Both new files are included in the
source distribution.
One re-entrant lock covers the enable flags, the log filter, and each line
write, so two threads cannot splice a line. `log()` holds it from the
filter decision through the write, and `warn()` holds it across the same
check. Recorded under **0.18.3**.
On import, logging and tracing take the first recognised value of
`DIAGNOSTICISM_*`, then `SIS_*`, then the generic name. That covers enable
flags, the logging threshold, and the flush threshold. An unrecognised
value falls through to the next name.
…module

Add `set_log_logger()`, which routes records without an explicit `file` to
a `logging.Logger`. `log()`, `warn()`, `trace()`, and `dbg()` share one
router. Trace and dbg records are now at `DEBUG5`, which the standard
logger receives as `DEBUG`. Records with a `file` argument still go to that
file. Added **examples/set_log_logger.py**.
@mwsis mwsis self-assigned this Nov 21, 2026
Restore `severity.TRACE` for `trace()`, `dbg()`, and `dbgfl()`. The
standard logger still receives those records as `DEBUG` via the severity
map; only the Diagnosticism severity and stderr label stay `TRACE`.
Mark the standard `logging` bridge done in **TODO.md**, and leave
**Pantheios.Python** open. **INSTALL.md** and **FAQ.md** cover
`set_log_logger()` and the environment variable names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant